angular.module("developprocess.service", [])
    .factory('develop_processService',['$http',function($http){
        var service = {};

        //获取某个项目某个产品下的某个产品下所有需求的处理人集合
        service.operatorsGet = function (data) {
            return $http({
                method: 'POST',
                url: "/api/requirement/getOperators",
                data: JSON.stringify(data),
                dataType:"application/json"
            });
        };

        //根据产品，处理人，状态，类型，优先级级别，关键字查找对应产品的所有需求信息
        service.requirementsGet = function (data) {
            return $http({
                method: 'POST',
                url: "/api/requirement/find",
                data: JSON.stringify(data),
                dataType:"application/json"
            });
        };

        //根据产品，时间度量获取代码审计的结果
        service.codeInfoGet = function (data) {
            return $http({
                method: 'GET',
                url: "/api/codeaudit/find",
                params:{'projectId':data.projectId,'productId':data.productId,'timeType':data.timeType}
            });
        };

        //根据产品列表获取所有产品的最新构建信息
        service.latestBuildInfo = function (data) {
            return $http({
                method: 'POST',
                url: "/api/jenkins/find",
                data: JSON.stringify(data),
                dataType:"application/json"
            });
        };


        return service;

    }])